#include<stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include<unistd.h>
#include<string.h>
int main(){
    int fd=open("file.txt",O_CREAT|O_WRONLY|O_APPEND,0666);
    const char *buff="hello world\n";
    while(1){
        write(fd,buff,strlen(buff));
        sleep(1);
    }

    return 0;
}
